package initialize

import (
	"github.com/gin-gonic/gin"
	"net/http"
	"virtual-resource-schedule-service/router"
	"virtual-resource-schedule-service/router/docker_router"
	"virtual-resource-schedule-service/router/kube_router"
	"virtual-resource-schedule-service/utils"
)

func Routers() *gin.Engine {
	Router := gin.Default()
	Router.GET("/health", func(c *gin.Context) {
		c.JSON(http.StatusOK, gin.H{
			"code":    "00000000",
			"message": "OK",
			"success": true,
		})
	})
	// 跨域配置
	Router.Use(utils.Cors())

	ApiGroup := Router.Group("/api/v1")
	kube_router.InitPodRouter(ApiGroup)
	docker_router.InitDockerContainerRouter(ApiGroup)
	router.InitAuthRouter(ApiGroup)

	return Router
}
